package com.zxhhyj.storm.common

import com.zxhhyj.storm.schema.Column
import com.zxhhyj.storm.schema.Table

@Suppress("UNCHECKED_CAST")
@OptIn(ExperimentalWasmJsInterop::class)
actual fun <T> packing(targetTable: Table<T>, selectColumns: List<Column<*, *>>, values: Map<String, *>): T {
    val model = js("{}")

    for ((key, value) in values) {
        model[key] = value
    }

    return model as T
}